package trainer;

import java.util.*;
import java.io.*;

public class StaticModel {

  HashMap<String, Double> static_unigram = new HashMap<String, Double>();

  HashMap<String, Double> static_bigram = new HashMap<String, Double>();

  HashMap<String, Double> static_trigram = new HashMap<String, Double>();

  HashMap<String, String> pos_rule = new HashMap<String, String>();

  /**
   * Read rules from file
   * @param filename
   */
  public void loadRules(String filename) {

    try {
      BufferedReader in = new BufferedReader(new FileReader(filename));
      String line = "";
      while ((line = in.readLine()) != null) {
        pos_rule.put(line, line);
      }
      in.close();
    } catch (IOException e) {
    }

  }

  /**
   * Judge whether the combination of tag is possible according to the rules.
   * @param terms
   * @return
   */
  public boolean isThisPossible(String terms) {
    boolean bAnswer = false;
    if (pos_rule.get(terms) == null)
      bAnswer = true;

    return bAnswer;
  }
}
